import java.util.Scanner;
public class A32{
	public static void main(String[] args){
		//将手机号码中间四位隐藏
		String phoneNumber = "12510254562";
		String start = phoneNumber.substring(0,3);
		String ending = phoneNumber.substring(7);
		System.out.println(start + "****" + ending);
		//身份证信息查看,输入身份证,输出出生日期和性别(奇数男偶数女)
		Scanner sc = new Scanner(System.in);
		System.out.println("请输入身份证号");
		String id = sc.next();
		String year = id.substring(6,10);
		String month = id.substring(10,12);
		String day = id.substring(12,14);
		char gender = judgeNumber(id.charAt(16)-48);
		//id.charAt(16)是一个字符型,运算之后由于整型提升,变成整型才能传给参数为Int型的方法
		//为什么是-48,因为减了之后是他本身的大小
		//'0'---> 48
		//'1'---> 49
		//'2'---> 50
		//'3'---> 51
		//'4'---> 52
		//'5'---> 53
		//'6'---> 54
		System.out.println("出生年月日:"+year+"年"+month+"月"+day+"日");
		System.out.println("性别为:"+gender);
		//替换敏感词
		String talk = "你玩的真好,以后不要再玩了,TMD,CNM";
		String[] arr = {"TMD","CNM","SB","MLGB"};
		for(int i = 0;i < arr.length;i++){
			talk = talk.replace(arr[i],"***");
		}
		System.out.println(talk);
	}
	public static char judgeNumber(int number){
		if(number%2==0){
			return '女';
		}else{
			return '男';
		}
	}	
}